home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
syslog.arc
/
SYSLOG.DOC
< prev
next >
Wrap
Text File
|
1990-03-26
|
7KB
|
197 lines
SYSLOG
Copyright (C) Wes Cowley 1990
All rights reserved
Purpose
-------
One feature of mainframe computers that I miss in the microcomputer world is
a system log. On the monster mainframes I've worked on every event that is
potentially interesting is logged. This provides a central location for
status messages and error messages. Until recently, micros didn't really
need something like this because they were running one program at a time,
usually with the operator right there watching the screen. Even if the
program wasn't being watching when something went wrong the number of error
logs that needed to be checked was minimized by fact that the user usually
knew what was running. With the growing number of micro systems running
multitasking software the need for such a log facility is becoming greater.
SysLog provides this feature for the DESQview environment. When run, SysLog
opens a window and waits for other programs to send log messages to it. When
a message is received, it is displayed to the window along with a timestamp.
There is an option to maintain a log file containing all incoming messages.
Messages sent to SysLog can be marked as being urgent. When an urgent message
is received SysLog will highlight the message and move its window to the top
of DESQview's window stack.
Usage
-----
SysLog comes with a .DVP file which contains the setup used on my system.
The Parameters line should be modified to match your needs. Case is not
significant in specifying parameters. The parameters currently recognized
by Syslog are:
/F<file name>
Specify the name of the log file that SysLog will maintain.
SysLog will append every message received to this file. The
default action if this parameter is not specified is to not
maintain a log file.
/M<mailbox name>
Specify the name of the mailbox that SysLog will open.
This allows multiple copies of SysLog to be running, each
receiving log messages from different sources. The default
mailbox name is SysLog.
/T<n>
Specify the number of seconds SysLog will wait after
receiving a message before committing the log file to
disk. When the file is committed no messages which have
been previously received will be lost in the event of a
system crash. The default is to wait 10 seconds. If /T0
is used, there will be almost no delay before committing
the file.
The command line I currently use is:
/Fc:\dv\utils\syslog.log /T30
Program Interface
-----------------
Messages may be sent to SysLog in one of two ways, through either the
Log utility or SysLog's API. The Log utility is the easiest method of
getting messages into the system log. It is most useful when run either
from a batch file or from an application script. The syntax is as follows:
Log [<flags>] <message>
The flags recognized by Log are:
/M<mailbox name>
Specifies the name of the mailbox that SysLog is using. See
the corresponding parameter to SysLog for more information.
The default mailbox name is SysLog.
/U
Specifies that the message is urgent.
For example:
Log "OOPS! Download was unsuccessful."
The other method of putting messages into the log requires that the sending
program be SysLog specific as well as DESQview specific. SysLog supports
a small applications program interface (API) through which a program
can communicate with SysLog.
The first step in using the SysLog API is to find it's mailbox. DESQview's
FINDMAIL command should be used to find the handle of SysLog's mailbox.
Unless the name has been changed with the /M parameter the mailbox name will
be SysLog. Once your program has the mailbox handle it can communicate with
SysLog. There are currently three commands supported by the SysLog: Link,
Unlink, and Message. The formats of these commands are as follows:
Format of Link message
----------------------
Total length: n bytes
Ofs Length Description
--- ------ -----------
0 1 Message type == 0 (SL_LINK)
1 1 Control flags
2 n-2 Program name (maximum length: 40 bytes)
Control flags:
Bit 0: 0 == announce link (default)
1 == do not announce link (SL_LINK_QUIET)
Bits 1 - 7: reserved
Format of Unlink message
------------------------
Total length: n bytes
Ofs Length Description
--- ------ -----------
0 1 Message type == 1 (SL_UNLINK)
1 1 Control flags
2 n-2 Program name (maximum length: 40 bytes)
Control flags:
Bit 0: 0 == announce unlink (default)
1 == do not announce unlink (SL_UNLINK_QUIET)
Bits 1 - 7: reserved
Format of Msg message
---------------------
Total length: n bytes
Ofs Length Description
--- ------ -----------
0 1 Message type == 2 (SL_MSG)
1 1 Control flags
2 n-2 Message (maximum length 256 bytes)
Control flags:
Bit 0: 0 == normal message (default)
1 == urgent message (SL_MSG_URGENT)
Bits 1 - 7: reserved
The Link and Unlink messages are used to inform SysLog that your program will
be using the log file for an extended period of time. SysLog will prevent
the user from closing the log window with anything short of a three finger
salute. The reason for using these commands is to protect your program from
the crash that would occur if SysLog's mailbox were to disappear while it was
being used. SysLog does not maintain a record of which programs linked to it,
other than displaying a log message if the SL_LINK_QUIET and SL_UNLINK_QUIET
options are not used. A count of linked programs is maintained. As long as
the count is greater than zero the user may not close the SysLog window.
The Msg command is used to send a log message to SysLog. It may be used
regardless of whether or not your program has linked to SysLog with the
Link command. The message will be displayed in the SysLog window and
recorded in the log file if it is open.
Distribution
------------
SysLog may be freely copied and distributed as long as no charge is made for
it other than normal online access charges.
Support
-------
I will try to provide any needed support through Bix. If you have problems,
suggestions, or complaints about this program don't hesitate to send them to
me there. Time permitting, I will try to act on them. I make no promises
that this program will work with any given hardware or software configuration
or that I will be able fix any problems you find using the program. This is
a free program written in my free time.
Wes Cowley (Bix: wcowley)
PO Box 280138
Tampa, FL 33682